const loader = require.context("./", false, /\.js$/);

const plugins = {};

for (let key of loader.keys()) {
    if (key === "./index.js") continue;
    let plugin = loader(key).default;
    let name = plugin.name.startsWith("plugin-") ? plugin.name.replace("plugin-", "") : "";
    if (name) plugins[name] = plugin;
}

export default plugins;